/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jaotwinker;

/**
 *
 * @author Grayson
 */
public class FileChooserXmlFilter extends javax.swing.filechooser.FileFilter {
    @Override
    public boolean accept(java.io.File f) {
        if (f.isDirectory()) {
            return true;
        }
        int dot = f.getAbsolutePath().lastIndexOf(".");
        String extension = f.getAbsolutePath().substring(dot+1);
        if (extension != null) {
            if (extension.equalsIgnoreCase("xml")) return true;
        } else { return false; }
        return false;
    }
    @Override
    public String getDescription() {
        return "XML Files";
    }
       
        
}
